<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>部门管理</title>
<link href="<?php echo base_url() ?>css/base.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url() ?>css/common.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url() ?>css/pages.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo base_url() ?>js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>js/Clock.js"></script>
<!--[if IE 6]><script type="text/javascript" src="<?php echo base_url() ?>js/pngfix.js"></script><![endif]-->
<script type="text/javascript" src="<?php echo base_url() ?>js/menu.js"></script>
<script type="text/javascript">
	function subret(){
		if(confirm('确定要删除所选信息？')){
			return;
		}
		return false;
	}
</script>
</head>

<body>
<div class="oaindex">
	<?php include 'system_header.php' ?>
    <div class="clearfix">
        <?php include 'system_left.php' ?>
		
		<!-- -----------------------------------编辑区---------------------------------- -->
		
        <div class="right_box"><form id="" name="form1" action="" method="">
            <div class="the_current">
				<span></span>
				<p>当前位置：首页&nbsp;&nbsp;>>&nbsp;&nbsp;部门管理</p>
            </div>
			<div class="sheet clearfix">
				<table width="740" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <th width="41"><input name="" type="checkbox" onclick="selsc()" value="" /></th>
                    <th width="79">部门ID</th>
                    <th width="285">组织架构</th>
                    <th width="335">操作</th>
                  </tr>
				  
				  	<?php
						foreach($list[0] as $v){
					?>
						<tr bgcolor="#E6EDF0">
							<td><input name="did" type="checkbox" value="" /></td>
							<td><?php echo $v['id'] ?></td>
							<td style="text-align:left; padding-left:5px"><?php echo $v['name'] ?></td>
							<td class="handle">
								<a href="/index.php/depart/add/<?php echo $v['id'] ?>">增加子部门</a>
								<a href="/index.php/depart/edit/<?php echo $v['id'] ?>">修改</a>
								<a href="/index.php/depart/del/<?php echo $v['id'] ?>" onclick="return subret()">删除</a>
								<a href="/index.php/user/index/<?php echo $v['id'] ?>">查看职员</a>
								<a href="/index.php/depart/power/<?php echo $v['id'] ?>">分配权限</a>
							</td>
						</tr>
					<?php
							if(@$list[$v['id']]){
								foreach($this->m->drawTree($list[$v['id']], $list, 0, '<span style="font-size:12px; color:#999999">├─</span>') as $vv){
					?>
						<tr>
							<td><input name="did" type="checkbox" value="" /></td>
							<td><?php echo $vv['id'] ?></td>
							<td style="text-align:left; padding-left:5px"><?php echo $vv['name'] ?></td>
							<td class="handle">
								<a href="/index.php/depart/add/<?php echo $vv['id'] ?>">增加子部门</a>
								<a href="/index.php/depart/edit/<?php echo $vv['id'] ?>">修改</a>
								<a href="/index.php/depart/del/<?php echo $vv['id'] ?>" onclick="return subret()">删除</a>
								<a href="/index.php/user/index/<?php echo $vv['id'] ?>">查看职员</a>
								<a href="/index.php/depart/power/<?php echo $vv['id'] ?>">分配权限</a>
							</td>
						</tr>
					<?php
								}
							}
							$this->m->datas = array();
						}
					?>                 
				  
                </table>

			</div>
            
            </form>
        </div>
		
		<!-- -----------------------------------编辑区---------------------------------- -->
		
    </div>
    <?php include 'system_footer.php' ?>
</div>

</body>
</html>
